package com.itheima.day05;

import java.time.LocalDate;
import java.time.Period;

public class Periodtest {
    public static void main(String[] args) {
        //随机写两个时间
        LocalDate now = LocalDate.now();
        LocalDate date = LocalDate.of(2025, 7, 20);
        //获取两个时间之间的间隔
        //用 Period的静态方法获得间隔
        Period period = Period.between(now, date);
        System.out.println(period.getYears() + "年" + period.getMonths() + "月" + period.getDays() + "天");
    }
}
